package com.example.design.bridge;

import com.example.design.bridge.brand.HuaWei;
import com.example.design.bridge.brand.XiaoMi;
import com.example.design.bridge.phone.FoldedPhone;
import com.example.design.bridge.phone.Phone;
import com.example.design.bridge.phone.UpRightPhone;

/**
 * 桥接模式实现 手机品牌与手机样式的多种组合
 */
public class Clint {
    public static void main(String[] args) {
        Phone foldedPhone = new FoldedPhone(new XiaoMi());
        foldedPhone.open();
        foldedPhone.closed();
        foldedPhone.call();

        System.out.println("------------------------");
        Phone foldedHuaWei = new FoldedPhone(new HuaWei());
        foldedHuaWei.open();
        foldedHuaWei.closed();
        foldedHuaWei.call();

        System.out.println("------------------------");
        Phone upRightXiaoMi = new UpRightPhone(new XiaoMi());
        upRightXiaoMi.open();
        upRightXiaoMi.closed();
        upRightXiaoMi.call();

        System.out.println("------------------------");
        Phone upRightHuaWei = new UpRightPhone(new HuaWei());
        upRightHuaWei.open();
        upRightHuaWei.closed();
        upRightHuaWei.call();
    }
}
